﻿using System;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;

namespace Hopscotch.Domain.Finance
{
    [MetadataType(typeof(TradeMetadata))]
    [JsonObject(ItemTypeNameHandling = TypeNameHandling.None)]
    public partial class Trade
    {

    }

    public class TradeMetadata
    {
        [Required(ErrorMessage = "Trade Date is required")]
        public DateTime TradeDt;

        [Required(ErrorMessage = "Quantity is required")]
        public decimal Qty;

        [Required(ErrorMessage = "Price is required")]
        [Range(0, Double.MaxValue, ErrorMessage = "Price can't be negative")]
        public decimal Price;

        [Required(ErrorMessage = "Currency is required")]
        public string TradeCcy;
    }

}
